<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>测试页面</title>
    <style>
        body {
            font-family: Arial, sans-serif;
            display: flex;
            justify-content: center;
            align-items: center;
            height: 100vh;
            margin: 0;
            background-color: #f5f5f5;
        }
        .container {
            text-align: center;
            padding: 2rem;
            background-color: white;
            border-radius: 8px;
            box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
        }
        h1 {
            color: #4CAF50;
        }
        button {
            background-color: #4CAF50;
            color: white;
            border: none;
            padding: 10px 20px;
            border-radius: 4px;
            cursor: pointer;
            font-size: 16px;
            margin-top: 20px;
        }
        button:hover {
            background-color: #45a049;
        }
    </style>
</head>
<body>
    <div class="container">
        <h1>前端服务测试页面</h1>
        <p>如果你能看到这个页面，说明前端服务运行正常！</p>
        <button onclick="testBackend()">测试后端连接</button>
        <p id="result"></p>
    </div>

    <script>
        function testBackend() {
            document.getElementById('result').textContent = '正在测试后端连接...';
            
            fetch('/api/health')
                .then(response => response.json())
                .then(data => {
                    document.getElementById('result').textContent = '后端连接成功！状态: ' + data.status;
                })
                .catch(error => {
                    document.getElementById('result').textContent = '后端连接失败: ' + error.message;
                });
        }
    </script>
</body>
</html> 